PHOTO BY TYLER MERBLER
Los Angeles, CA has a population of 3.98M people with a median age of 35.6 and a median household income of $54,432.
Let’s take a look at the tech industry employment numbers for the past 13 years.
# add geom_hline showing "Total media wages"
# # Change the "horizontal justification" to be left-justified with hjust
mycols <- c("blue", "red")
ggplot(data=occupation, mapping=aes(x=industry, y=median_wages17, fill=compu)) +
stat_summary(fun.y=mean, geom="bar") +
scale_y_continuous(labels=dollar) +
labs(title="Median Wages by Industry in 2017", x="", y="") +
coord_flip() +
theme(legend.position="none") +
scale_fill_manual(values=mycols) +
geom_text(aes(label = median_wages17), color = "black", hjust=-0.1) +
geom_hline(yintercept = 37690, color="red", size=1, linetype="dashed")# remove all occupations
occupation <- occupation[2:23,]
occupation$industry <- fct_reorder(occupation$industry, occupation$change2026, mean, na.rm=TRUE)
ggplot(data=occupation, mapping=aes(x=industry, y=change2026, fill=compu)) +
stat_summary(fun.y=mean, geom="bar") +
scale_y_continuous() +
labs(title="Employment Jobs Growth Projection by Industry 2016-2026 ", x="", y="") +
coord_flip() +
theme(legend.position="none") +
scale_fill_manual(values=mycols) +
geom_text(aes(label = change2026), color = "black", hjust=-0.1) occupation$industry <- fct_reorder(occupation$industry, occupation$perchange206, mean, na.rm=TRUE)
ggplot(data=occupation, mapping=aes(x=industry, y=perchange206, fill=compu)) +
stat_summary(fun.y=mean, geom="bar") +
scale_y_continuous() +
labs(title="% Employment Growth Projection by Industry 2016-2026 ", x="", y="") +
coord_flip() +
theme(legend.position="none") +
scale_fill_manual(values=mycols) +
geom_text(aes(label = perchange206), color = "black", hjust=-0.1)2017 Employment by major occupational group, 2016 and projected 2026 (Numbers in thousands) [1]. Tech employees are compensated nicely due to this tech boom. For example, in 207 while the annual medialn wage for all occupations was $37,000 in the U.S., it was $84,600 for the computer occupations, second only to $102,000 of the management occupations as shown in Table 1.
# Tech
# Set zero margins in plot window, so that map fits
par(mar=c(0,0,0,0))
# plot(zips.shp, lwd=0.1)
# One dot per 10 people
plotvar <- df.17$tech/10
# Calculated random dots for each zip code and store the coordinates in cadots.rand
cadots.rand <- dotsInPolys(zips.shp, as.integer(plotvar), f="random")
# Plot a specific region - zooms in LA conty
plot(zips.shp, lwd=0.1, xlim=c(-118.510000,-117.820000), ylim=c(33.710000,34.860000))
plot(cadots.rand, add=T, pch=19, cex=0.1, col="#000080", border="red") # Blue ---- "#09900d" Green# Info
# Set zero margins in plot window, so that map fits
# par(mar=c(0,0,0,0))
# # plot(zips.shp, lwd=0.1)
#
# # One dot per 10 people
# plotvar1 <- df.17$info/10
#
# # Calculated random dots for each zip code and store the coordinates in cadots.rand
# cadots.rand <- dotsInPolys(zips.shp, as.integer(plotvar1), f="random")
#
# # Plot a specific region - zooms in LA conty
# plot(zips.shp, lwd=0.1, xlim=c(-118.510000,-117.820000), ylim=c(33.710000,34.860000))
# plot(cadots.rand, add=T, pch=19, cex=0.1, col="#8B0000", border="red") # Blue ---- "#09900d" Green # #8B0000 Red # #FF4500 Orange
# Professional
# Set zero margins in plot window, so that map fits
# par(mar=c(0,0,0,0))
# # plot(zips.shp, lwd=0.1)
#
# # One dot per 10 people
# plotvar2 <- df.17$prof/10
#
# # Calculated random dots for each zip code and store the coordinates in cadots.rand
# cadots.rand <- dotsInPolys(zips.shp, as.integer(plotvar2), f="random")
#
# # Plot a specific region - zooms in LA conty
# plot(zips.shp, lwd=0.1, xlim=c(-118.510000,-117.820000), ylim=c(33.710000,34.860000))
# plot(cadots.rand, add=T, pch=19, cex=0.1, col="#FF4500", border="red") # Blue ---- "#09900d" Green # #8B0000 Red # #FF4500 Orange
rm(plotvar)
rm(cadots.rand)
rm(cacounties)
rm(cacounties.shp)
rm(cnty.zips)
rm(cnty.zips.17)2017 Dot density zip code map
Each dot = 10 tech jobs
# install imageMagick
# https://www.imagemagick.org/script/download.php#windows
# Tutorials
# https://ryanpeek.github.io/2016-10-19-animated-gif_maps_in_R/
# https://cran.r-project.org/web/packages/magick/vignettes/intro.html
# library(magick) # this is call to animate/read pngs
# save all png files to path folder
# create gif
# list.files(path = "C:/Users/joao_/Downloads/Gif/", pattern = "*.png", full.names = T) %>%
# map(image_read) %>% # reads each path file
# image_join() %>% # joins image
# image_animate(fps=100) %>% # animates, can opt for number of loops
# image_write("tech_100.gif") # write to current dir